var dataFont = {
    "宋体": "SimSun",
    "黑体": "SimHei",
    "微软雅黑": "Microsoft Yahei",
    "微软正黑体": "Microsoft JhengHei",
    "楷体": "KaiTi",
    "新宋体": "NSimSun",
    "仿宋": "FangSong",
    "苹方": "PingFang SC",
    "华文黑体": "STHeiti",
    "华文楷体": "STKaiti",
    "华文宋体": "STSong",
    "华文仿宋": "STFangsong",
    "华文中宋": "STZhongsong",
    "华文琥珀": "STHupo",
    "华文新魏": "STXinwei",
    "华文隶书": "STLiti",
    "华文行楷": "STXingkai",
    "冬青黑体简": "Hiragino Sans GB",
    "兰亭黑-简": "Lantinghei SC",
    "翩翩体-简": "Hanzipen SC",
    "手札体-简": "Hannotate SC",
    "宋体-简": "Songti SC",
    "娃娃体-简": "Wawati SC",
    "魏碑-简": "Weibei SC",
    "行楷-简": "Xingkai SC",
    "雅痞-简": "Yapi SC",
    "圆体-简": "Yuanti SC",
    "幼圆": "YouYuan",
    "隶书": "LiSu",
    "华文细黑": "STXihei",
    "华文彩云": "STCaiyun",
    "方正舒体": "FZShuTi",
    "方正姚体": "FZYaoti",
    "思源黑体": "Source Han Sans CN",
    "思源宋体": "Source Han Serif SC",
    "文泉驿微米黑": "WenQuanYi Micro Hei",
    "汉仪旗黑": "HYQihei 60S",
    "汉仪大宋简": "HYDaSongJ",
    "汉仪楷体": "HYKaiti",
    "汉仪家书简": "HYJiaShuJ",
    "汉仪PP体简": "HYPPTiJ",
    "汉仪乐喵体简": "HYLeMiaoTi",
    "汉仪小麦体": "HYXiaoMaiTiJ",
    "汉仪程行体": "HYChengXingJ",
    "汉仪黑荔枝": "HYHeiLiZhiTiJ",
    "汉仪雅酷黑W": "HYYaKuHeiW",
    "汉仪大黑简": "HYDaHeiJ",
    "汉仪尚魏手书W": "HYShangWeiShouShuW",
    "方正粗雅宋简体": "FZYaSongS-B-GB",
    "方正报宋简体": "FZBaoSong-Z04S",
    "方正粗圆简体": "FZCuYuan-M03S",
    "方正大标宋简体": "FZDaBiaoSong-B06S",
    "方正大黑简体": "FZDaHei-B02S",
    "方正仿宋简体": "FZFangSong-Z02S",
    "方正黑体简体": "FZHei-B01S",
    "方正琥珀简体": "FZHuPo-M04S",
    "方正楷体简体": "FZKai-Z03S",
    "方正隶变简体": "FZLiBian-S02S",
    "方正隶书简体": "FZLiShu-S01S",
    "方正美黑简体": "FZMeiHei-M07S",
    "方正书宋简体": "FZShuSong-Z01S",
    "方正舒体简体": "FZShuTi-S05S",
    "方正水柱简体": "FZShuiZhu-M08S",
    "方正宋黑简体": "FZSongHei-B07S",
    "方正宋三简体": "FZSong",
    "方正魏碑简体": "FZWeiBei-S03S",
    "方正细等线简体": "FZXiDengXian-Z06S",
    "方正细黑一简体": "FZXiHei I-Z08S",
    "方正细圆简体": "FZXiYuan-M01S",
    "方正小标宋简体": "FZXiaoBiaoSong-B05S",
    "方正行楷简体": "FZXingKai-S04S",
    "方正姚体简体": "FZYaoTi-M06S",
    "方正中等线简体": "FZZhongDengXian-Z07S",
    "方正准圆简体": "FZZhunYuan-M02S",
    "方正综艺简体": "FZZongYi-M05S",
    "方正彩云简体": "FZCaiYun-M09S",
    "方正隶二简体": "FZLiShu II-S06S",
    "方正康体简体": "FZKangTi-S07S",
    "方正超粗黑简体": "FZChaoCuHei-M10S",
    "方正新报宋简体": "FZNew BaoSong-Z12S",
    "方正新舒体简体": "FZNew ShuTi-S08S",
    "方正黄草简体": "FZHuangCao-S09S",
    "方正少儿简体": "FZShaoEr-M11S",
    "方正稚艺简体": "FZZhiYi-M12S",
    "方正细珊瑚简体": "FZXiShanHu-M13S",
    "方正粗宋简体": "FZCuSong-B09S",
    "方正平和简体": "FZPingHe-S11S",
    "方正华隶简体": "FZHuaLi-M14S",
    "方正瘦金书简体": "FZShouJinShu-S10S",
    "方正细倩简体": "FZXiQian-M15S",
    "方正中倩简体": "FZZhongQian-M16S",
    "方正粗倩简体": "FZCuQian-M17S",
    "方正胖娃简体": "FZPangWa-M18S",
    "方正宋一简体": "FZSongYi-Z13S",
    "方正剪纸简体": "FZJianZhi-M23S",
    "方正流行体简体": "FZLiuXingTi-M26S",
    "方正祥隶简体": "FZXiangLi-S17S",
    "方正粗活意简体": "FZCuHuoYi-M25S",
    "方正胖头鱼简体": "FZPangTouYu-M24S",
    "方正卡通简体": "FZKaTong-M19S",
    "方正艺黑简体": "FZYiHei-M20S",
    "方正水黑简体": "FZShuiHei-M21S",
    "方正古隶简体": "FZGuLi-S12S",
    "方正幼线简体": "FZYouXian-Z09S",
    "方正启体简体": "FZQiTi-S14S",
    "方正小篆体": "FZXiaoZhuanTi-S13T",
    "方正硬笔楷书简体": "FZYingBiKaiShu-S15S",
    "方正毡笔黑简体": "FZZhanBiHei-M22S",
    "方正硬笔行书简体": "FZYingBiXingShu-S16S",
    "草书":"cursive",
    "无衬线细体":"sans-serif-thin",

}


var isSupportFontFamily = function(f) {
    //    f是要检测的字体
    if(typeof f != "string") 
    {
        return false
    }
    // h是基础字体
    var h = "Arial";

    if(f.toLowerCase() == h.toLowerCase()) {
        return true
    }
    // 设置一个检测的字符A,看他是否支持f字体
    var e = "a";
    var d = 1;
    var a = 1,
    i = 1;
    var c = document.createElement("canvas");
    var b = c.getContext("2d");
    c.width = a;
    c.height = i;
    b.textAlign = "center";
    b.fillStyle = "black";
    b.textBaseline = "middle";
    var g = function(j) 
    {
        b.clearRect(0, 0, a, i);
        //字体是传入的j,或者是默认的h
        b.font = d + "px " + j + ", " + h;
        b.fillText(e, a , i );
        // 获取所有的canvas图片信息
        var k = b.getImageData(0, 0, a, i).data;
        //k调用数组的 filter方法,筛选符合条件的。改变原数组。
        return [].slice.call(k).filter(function(l)
        {
            return l != 0
        });
    };
    return    g(h).join("") !== g(f).join("");
};
